import { Model, DataType, } from "sequelize-typescript";
import { Table, Column } from './decorate';

@Table({
    underscored: true,
    underscoredAll: true,
    timestamps: true,
    paranoid: true,
    indexes: [
        {
            fields: ['ordered']
        },
        {
            fields: ['type']
        }
    ]
})
export default class MenuColumn extends Model<MenuColumn> { 

    @Column
    name !: string ;

    @Column({
        type: DataType.DOUBLE
    })
    ordered !: number ;

    @Column
    type !: MenuColumnType ;

    @Column
    value !: string ;
}

export enum MenuColumnType { 
    ARTICLE_CATEGORY = 1,
    SINGLE_PAGE = 2,
    LINK = 3
}